﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Jzy;

namespace ECommerce.Model.Order
{
    public partial class ECOrderInfo : EntityBase
    {
        private const string TABLE_NAME = "ECOrder";
        private const string INSERT_SQL = "insert into ECOrder ( [ID], [MemberID], [MemberLoginName], [MemberRemain], [TradeValue], [Freight], [SendName], [SendGender], [SendArea], [SendAddress], [SendMobile], [RecieveAddress], [RecieveName], [RecieveMobile], [RecieveGender], [TakeAddress], [InputTime], [DeliverTime], [BuyerIP], [OrderState], [PayState], [PayMode], [Remark], [Wishes], [Anonymity], [LogisticsType], [DeliverPart], [RecieveArea], [InvoiceTarget], [InvoiceHead], [BigArea], [RecieveBigArea]) values ( @ID, @MemberID, @MemberLoginName, @MemberRemain, @TradeValue, @Freight, @SendName, @SendGender, @SendArea, @SendAddress, @SendMobile, @RecieveAddress, @RecieveName, @RecieveMobile, @RecieveGender, @TakeAddress, @InputTime, @DeliverTime, @BuyerIP, @OrderState, @PayState, @PayMode, @Remark, @Wishes, @Anonymity, @LogisticsType, @DeliverPart, @RecieveArea, @InvoiceTarget, @InvoiceHead, @BigArea, @RecieveBigArea)";
        private const string UPDATE_SQL = "update ECOrder set  [ID] = @ID, [MemberID] = @MemberID, [MemberLoginName] = @MemberLoginName, [MemberRemain] = @MemberRemain, [TradeValue] = @TradeValue, [Freight] = @Freight, [SendName] = @SendName, [SendGender] = @SendGender, [SendArea] = @SendArea, [SendAddress] = @SendAddress, [SendMobile] = @SendMobile, [RecieveAddress] = @RecieveAddress, [RecieveName] = @RecieveName, [RecieveMobile] = @RecieveMobile, [RecieveGender] = @RecieveGender, [TakeAddress] = @TakeAddress, [InputTime] = @InputTime, [DeliverTime] = @DeliverTime, [BuyerIP] = @BuyerIP, [OrderState] = @OrderState, [PayState] = @PayState, [PayMode] = @PayMode, [Remark] = @Remark, [Wishes] = @Wishes, [Anonymity] = @Anonymity, [LogisticsType] = @LogisticsType, [DeliverPart] = @DeliverPart, [RecieveArea] = @RecieveArea, [InvoiceTarget] = @InvoiceTarget, [InvoiceHead] = @InvoiceHead, [BigArea] = @BigArea, [RecieveBigArea] = @RecieveBigArea where ID = @ID";
        /// <summary>
        /// PK(订单号)
        /// </summary>
        public Int64 ID
        {
            get;
            set;
        }
        /// <summary>
        /// 会员ID
        /// </summary>
        public Int32 MemberID
        {
            get;
            set;
        }
        /// <summary>
        /// 会员名
        /// </summary>
        public String MemberLoginName
        {
            get;
            set;
        }
        /// <summary>
        /// 交易前账户余额
        /// </summary>
        public Double MemberRemain
        {
            get;
            set;
        }
        /// <summary>
        /// 交易额
        /// </summary>
        public Double TradeValue
        {
            get;
            set;
        }
        /// <summary>
        /// 运费
        /// </summary>
        public Double Freight
        {
            get;
            set;
        }
        /// <summary>
        /// 订单人姓名
        /// </summary>
        public String SendName
        {
            get;
            set;
        }
        /// <summary>
        /// 订单人性别
        /// </summary>
        public String SendGender
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public String SendArea
        {
            get;
            set;
        }
        /// <summary>
        /// 订单人地址
        /// </summary>
        public String SendAddress
        {
            get;
            set;
        }
        /// <summary>
        /// 订单人电话
        /// </summary>
        public String SendMobile
        {
            get;
            set;
        }
        /// <summary>
        /// 收货地址
        /// </summary>
        public String RecieveAddress
        {
            get;
            set;
        }
        /// <summary>
        /// 收货人
        /// </summary>
        public String RecieveName
        {
            get;
            set;
        }
        /// <summary>
        /// 联系电话
        /// </summary>
        public String RecieveMobile
        {
            get;
            set;
        }
        /// <summary>
        /// 收货人性别
        /// </summary>
        public String RecieveGender
        {
            get;
            set;
        }
        /// <summary>
        /// 取货地址
        /// </summary>
        public String TakeAddress
        {
            get;
            set;
        }
        /// <summary>
        /// 下单时间
        /// </summary>
        public DateTime InputTime
        {
            get;
            set;
        }
        /// <summary>
        /// 送货时间
        /// </summary>
        public DateTime DeliverTime
        {
            get;
            set;
        }
        /// <summary>
        /// 购买者IP
        /// </summary>
        public String BuyerIP
        {
            get;
            set;
        }
        /// <summary>
        /// 订单状态(未处理、已处理、结束)
        /// </summary>
        public Int32 OrderState
        {
            get;
            set;
        }
        /// <summary>
        /// 支付状态(未付款、已付款、处理中、交易完成、已取消)
        /// </summary>
        public Int32 PayState
        {
            get;
            set;
        }
        /// <summary>
        /// 付款方式(货到付款、在线支付)
        /// </summary>
        public Int32 PayMode
        {
            get;
            set;
        }
        /// <summary>
        /// 特殊要求
        /// </summary>
        public String Remark
        {
            get;
            set;
        }
        /// <summary>
        /// 祝福语
        /// </summary>
        public String Wishes
        {
            get;
            set;
        }
        /// <summary>
        /// 是否匿名
        /// </summary>
        public Boolean Anonymity
        {
            get;
            set;
        }
        /// <summary>
        /// 物流类型
        /// </summary>
        public Int32 LogisticsType
        {
            get;
            set;
        }
        /// <summary>
        /// 送货时段
        /// </summary>
        public String DeliverPart
        {
            get;
            set;
        }
        /// <summary>
        /// 收货区域
        /// </summary>
        public String RecieveArea
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 InvoiceTarget
        {
            get;
            set;
        }
        /// <summary>
        /// 发票抬头
        /// </summary>
        public String InvoiceHead
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 BigArea
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 RecieveBigArea
        {
            get;
            set;
        }
        public override void SetValue(string key, object value)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    this.ID = (Int64)value;
                    break;
                case "memberid":
                    this.MemberID = (Int32)value;
                    break;
                case "memberloginname":
                    this.MemberLoginName = (String)value;
                    break;
                case "memberremain":
                    this.MemberRemain = (Double)value;
                    break;
                case "tradevalue":
                    this.TradeValue = (Double)value;
                    break;
                case "freight":
                    this.Freight = (Double)value;
                    break;
                case "sendname":
                    this.SendName = (String)value;
                    break;
                case "sendgender":
                    this.SendGender = (String)value;
                    break;
                case "sendarea":
                    this.SendArea = (String)value;
                    break;
                case "sendaddress":
                    this.SendAddress = (String)value;
                    break;
                case "sendmobile":
                    this.SendMobile = (String)value;
                    break;
                case "recieveaddress":
                    this.RecieveAddress = (String)value;
                    break;
                case "recievename":
                    this.RecieveName = (String)value;
                    break;
                case "recievemobile":
                    this.RecieveMobile = (String)value;
                    break;
                case "recievegender":
                    this.RecieveGender = (String)value;
                    break;
                case "takeaddress":
                    this.TakeAddress = (String)value;
                    break;
                case "inputtime":
                    this.InputTime = (DateTime)value;
                    break;
                case "delivertime":
                    this.DeliverTime = (DateTime)value;
                    break;
                case "buyerip":
                    this.BuyerIP = (String)value;
                    break;
                case "orderstate":
                    this.OrderState = (Int32)value;
                    break;
                case "paystate":
                    this.PayState = (Int32)value;
                    break;
                case "paymode":
                    this.PayMode = (Int32)value;
                    break;
                case "remark":
                    this.Remark = (String)value;
                    break;
                case "wishes":
                    this.Wishes = (String)value;
                    break;
                case "anonymity":
                    this.Anonymity = (Boolean)value;
                    break;
                case "logisticstype":
                    this.LogisticsType = (Int32)value;
                    break;
                case "deliverpart":
                    this.DeliverPart = (String)value;
                    break;
                case "recievearea":
                    this.RecieveArea = (String)value;
                    break;
                case "invoicetarget":
                    this.InvoiceTarget = (Int32)value;
                    break;
                case "invoicehead":
                    this.InvoiceHead = (String)value;
                    break;
                case "bigarea":
                    this.BigArea = (Int32)value;
                    break;
                case "recievebigarea":
                    this.RecieveBigArea = (Int32)value;
                    break;
            }
        }
    }


}
